import * as types from '../constants/ActionTypes';

var date = new Date();

const initialState = {
	time: '',
	message: ''
};

export default function (state = initialState, action) {
	const {payload={}} = action;
	const {error=''} = payload;

	if (error) {
		return {
			...state,
			time: (new Date()).toTimeString(),
			message: error
		}
	}

	return state;
}
